package com.pro1.controller;


import com.comm.entity.Product;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("product")
public class ProductController {

    @GetMapping("{id}")
    public Product getProById(@PathVariable Integer id){
         if(id==1){
             return new Product(11,"test1",3001);
         }else{
             return new Product(121,"test12",30001);
         }

    }

}
